package com.eascs.web.p2p.common.controller;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.site.view.BaseRestResult;
import com.eascs.site.view.MessageRestResult;
import com.eascs.web.p2p.common.interceptor.NoAccessException;

public abstract class BaseActionRestController extends BaseViewController {
	private final Logger logger = LoggerFactory.getLogger(BaseActionRestController.class);
	
	
	@ExceptionHandler(NoAccessException.class)
	@ResponseBody
	public MessageRestResult exception(NoAccessException ex) {
		logger.warn(ex.getMessage(), ex);
		return BaseRestResult.warn(ex.getMessage());
	}
}